import http from "@/api";

import { ResPage } from "@/api/interface";

import { DealerCardEntity, DealerCardVo } from "@/biz/interface/modules/DealerCardType";

import { ModuleFlexJobUrl } from "..";
import { OptionVo } from "@/biz/interface";

const moduleUrl = ModuleFlexJobUrl;

// * 获取dealerCard列表
export const getDealerCardVoListApi = (params: {}) => {
  return http.post<ResPage<DealerCardVo>>(moduleUrl + `/dealwalletapi/dealercards`, params);
};

// * 获取经销商绑定的银行卡
export const getUserBankDropsApi = () => {
  return http.post<ResPage<OptionVo>>(moduleUrl + `/dealwalletapi/dealercardsdrop`, {});
};

// * 新增dealerCard接口
export const saveDealerCardApi = (dealerCard: DealerCardEntity) => {
  return http.post(moduleUrl + `/dealwalletapi/bindcard`, dealerCard);
};

// * 详情dealerCard接口
export const getDealerCardInfoApi = (params: { id: string }) => {
  return http.post<DealerCardEntity>(moduleUrl + `/dealwalletapi/cardinfo`, params);
};

// * 删除dealerCard接口
export const deleteDealerCardApi = (params: { id: string }) => {
  return http.post(moduleUrl + `/dealwalletapi/removecard`, params);
};
